<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset={$defaultCharset|escape}" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	

	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />

	<link rel="stylesheet" type="text/css" href="{$baseUrl}/styles/dm.css">


	<!-- Base Jquery -->
	{*
	{if $allowCDN}<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">{literal}
		// Provide a local fallback if the CDN cannot be reached
		if (typeof google == 'undefined') {
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js' type='text/javascript'%3E%3C/script%3E"));
		} else {
			google.load("jquery", "{/literal}{$smarty.const.CDN_JQUERY_VERSION}{literal}");
			google.load("jqueryui", "{/literal}{$smarty.const.CDN_JQUERY_UI_VERSION}{literal}");
		}
	{/literal}</script>
	{else}
	*}
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>
	{*{/if}
	*}

	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/danhmuc.js"></script>

</head>


{strip}
{assign var="pageTitle" value="Danh muc ĐVCS"}
{assign var="socot" value="4"}
{include file="acct/acctNavbar.tpl"}
{include file="acct/breadcrumbs.tpl"}
{url|assign:"InsUrl" op="DMDVCS_Ins"}
{/strip}

<body2 style="font-size:12px">
{assign var="ma_dvcs" value=""}
{assign var="ten_dvcs" value=""}

<div id = "search" style= "text-align: center; padding: 10px 20px ; width:100%; color: #458B74" >
<strong style="font-size: 2em;" >DANH MỤC ĐƠN VỊ CƠ SỞ</strong>
	
<form method="post" action="{url page='acctKT' op='KT_DMDVCS'}">
	&nbsp;&nbsp;&nbsp;
	<br>
	<br>
	<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>
	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>

	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
</form>
</div>
<br>
<br>


<div id = "create" style="display: none; width:80%;  margin-left: auto; margin-right: auto;">
	<table width="100%" style = " border: thin black solid;">
	<tr valign="bottom" height = "40px">
	<td colspan = "2" id = "create_title" width="100%" style = "text-align: center; padding: 0 ; width:100%; color: #458B74;font-size: 1.2em; font-weight: bold; border-width: 0;" > Thêm ĐVCS mới </td>
	</tr>
	<tr valign="top" height = "1px">
		<td colspan = "2">
		<hr size="2" width="10%" noshade style="color:#000000" align="center" />
		</td>
	</td>
	<tr height = "5px">
	</tr>



	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="ma">Mã ĐVCS: &nbsp</label></td>
		<td width="80%" class="value"><input type="text" name="ma_dvcs" value="{$ma_dvcs}" id="ma_dvcs" size="1" maxlength="1" style="text-transform:uppercase"class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="ten">T&#234;n ĐVCS :&nbsp</label></td>
		<td width="80%" class="value"><input type="text" name="ten_dvcs" value="{$ten_dvcs}" id="ten_dvcs" size="40" style="width:99%" class="textField" /></td>
	</tr>
			


	<tr valign="top">
	</tr>

	<tr valign="top" height = "40px">
	<td colspan = "2" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-weight: bold;"> 
	<input type="button" id = "createbutton" value="Thêm mới" class="button defaultButton" onclick="SaveDMDVCS('{$InsUrl}');" /> <input type="button" value="{translate key="common.cancel"}" class="button defaultButton" onclick="RTFcreate();" />
	</td></tr>

	</table>
	<br>
	<br>
</div> 

<table width = "80%" align="center">
<tr>
<td width = "50%">
	<div id = "btnThem"> 
	<input type="button" id="button_id" value="Th&#234;m ĐVCS"  class="button" style= "text-align: left;"  onClick="createDVCS();"> 
	</div>
</td>
<td width = "50%" style= "text-align: right; 	font-weight: bold;">
<label >{$searchSql}</label>
</td>
</tr>
</table>

<div id="sections">

<table width="80%" id="customers" align="center">
	<tr valign="bottom">
		<th >M&#227; ĐVCS</th>
		<th >T&#234;n ĐVCS</th>

		<th align="right">{translate key="common.action"}</th>
	</tr>

	
{assign var="dong" value="0"}
{assign var="stt" value="0"}
{iterate from=dms item=dm name=dms}
	{assign var = "ma_dvcs" value = $dm->getma()}
	{assign var = "ten_dvcs" value = $dm->getten()|escape}
	{assign var="dong" value=$dong+1}


	{if $stt ==0}
		{assign var="stt" value="1"}
		<tr valign="top" >
			<td class="drag">
			{$dm->getma()|escape}</td>
			<td class="drag">{$dm->getten()|escape}</td>

			<td align="right" class="nowrap">
				<a href="#" class="action" id ={$dong} onclick="editDMDVCS('{$ma_dvcs}', '{$ten_dvcs}', this.id)">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url page="acctKT" op="DMDVCS_Del" path=$dm->getma()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa ĐVCS $ten_dvcs"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{else}
		{assign var="stt" value="0"}
		<tr valign="top" class="alt">
			<td class="drag">{$dm->getma()|escape}</td>
			<td class="drag">{$ten_dvcs}</td>

			<td align="right" class="nowrap">
				<a href="#" class="action" id ={$dong} onclick="editDMDVCS('{$ma_dvcs}', '{$ten_dvcs}', this.id)">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url page="acctKT" op="DMDVCS_Del" path=$dm->getma()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa ĐVCS $ten_dvcs"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{/if}
{/iterate}

<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

</table>
</div>
</body2>
{include file="common/footer.tpl"}
</html>

